package com.hghivln.erpwarehouse.system.mapper;

import com.hghivln.erpwarehouse.system.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hghivln
 * @since 2021-06-19
 */
public interface MenuMapper extends BaseMapper<Menu> {

    /**
     * 查询最大的排序码
     */
    @Select("select max(ordernum) from sys_menu")
    Integer queryMenuMaxOrderNum();

    /**
     * 返回当前菜单的子节点的数量
     */
    @Select("select count(1) from sys_menu where pid = #{id}")
    Integer getMenuChildrenCountById(Integer id);


}
